<template>
  <div class="row">
    <div class="col-sm-6">
      <label for="inputPassword" class="col-sm-2 col-form-label"
        >题干</label
      >
    </div>
    <div class="col-sm-6">
      {{ question.stem }}
    </div>
    <div class="col-sm-6">
      <label for="inputPassword" class="col-sm-2 col-form-label">试题类型</label>
    </div>
    <div class="col-sm-6">
      {{ question.questionType.qtname }}
    </div>
    <div class="col-sm-6">
      <label for="inputPassword" class="col-sm-2 col-form-label">难度</label>
    </div>
    <div class="col-sm-6">
      {{ question.difficulty.dname }}
    </div>
    <div class="col-sm-6">
      <label for="inputPassword" class="col-sm-2 col-form-label">学科</label>
    </div>
    <div class="col-sm-6">
      {{ question.subject.sname }}
    </div>
    <div class="col-sm-6">
      <label for="inputPassword" class="col-sm-2 col-form-label">阶段</label>
    </div>
    <div class="col-sm-6">
      {{ question.stage.stname }}
    </div>
    <div class="col-sm-6">
      <label for="inputPassword" class="col-sm-2 col-form-label">选项A</label>
    </div>
    <div class="col-sm-6">
      {{ question.optionA }}
    </div>
    <div class="col-sm-6">
      <label for="inputPassword" class="col-sm-2 col-form-label">选项B</label>
    </div>
    <div class="col-sm-6">
      {{ question.optionB }}
    </div>
    <div class="col-sm-6">
      <label for="inputPassword" class="col-sm-2 col-form-label">选项C</label>
    </div>
    <div class="col-sm-6">
      {{ question.optionC }}
    </div>
    <div class="col-sm-6">
      <label for="inputPassword" class="col-sm-2 col-form-label">选项D</label>
    </div>
    <div class="col-sm-6">
      {{ question.optionD }}
    </div>
    <div class="col-sm-6">
      <label for="inputPassword" class="col-sm-2 col-form-label">选项E</label>
    </div>
    <div class="col-sm-6">
      {{ question.optionE }}
    </div>
    <div class="col-sm-6">
      <label for="inputPassword" class="col-sm-2 col-form-label">答案</label>
    </div>
    <div class="col-sm-6">
      {{ question.answer }}
    </div>
    <el-button type="primary" @click="edit" style="margin-left: 550px"
      >编辑</el-button
    >
    <el-button @click="goBack">返回</el-button>
  </div>
</template>

<script>
export default {
  name: "QuestionView",
  data() {
    return {
      question: {},
    };
  },
  props: {
    id: {
      required: true,
    },
  },
  mounted() {
    this.$parent.questionTitle = "难度查看";
    this.getQuestion();
  },
  methods: {
    getQuestion() {
      this.axiosJSON.get("/question/getOne?id=" + this.id).then((result) => {
        this.question = result.data.data;
      });
    },
    goBack() {
      this.$router.push("/question/list");
    },
    edit() {
      this.$router.push("/question/modify/" + this.id);
    },
    getQTList() {
      this.axiosJSON.get("/questionType/getAll").then((result) => {
        this.questionTypeList = result.data.data;
      });
    },
    getDifList() {
      this.axiosJSON.get("/difficulty/getAll").then((result) => {
        this.difficultyList = result.data.data;
      });
    },
    getStageList() {
      this.axiosJSON
        .get("/stage/getAllWithSubjectID?subjectId=" + this.form.subject.id)
        .then((result) => {
          this.stageList = result.data.data;
        });
    },
    getSubjectList() {
      this.axiosJSON.post("/subject/getAllWithoutPage").then((result) => {
        this.subjectList = result.data.data;
      });
    },
  },
};
</script>

<style>
</style>